<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>社交专题推荐</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    
    <style>
        /* 基础样式 */
        body {
            font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background-color: #f5f7fa;
            color: #333;
        }
        
        .container {
            max-width: 1200px;
        }
        
        /* 页面标题 */
        .page-header {
            padding: 2rem 0;
            border-bottom: 1px solid #e1e4e8;
            margin-bottom: 2rem;
        }
        
        .page-title {
            font-weight: 700;
            color: #2d3748;
            margin-bottom: 0.5rem;
        }
        
        .page-description {
            color: #718096;
            font-size: 1.1rem;
        }
        
        /* 专题分类标题 */
        .section-title {
            font-weight: 600;
            margin: 2.5rem 0 1.5rem;
            padding-bottom: 0.75rem;
            border-bottom: 2px solid #3b82f6;
            color: #2d3748;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }
        
        /* 专题卡片样式 */
        .topic-card {
            background-color: white;
            border-radius: 10px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            overflow: hidden;
            transition: all 0.3s ease;
            margin-bottom: 1.5rem;
        }
        
        .topic-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        }
        
        /* 专题标签 */
        .topic-tag {
            display: inline-block;
            padding: 0.25rem 0.75rem;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 600;
            margin-right: 0.5rem;
            margin-bottom: 0.5rem;
        }
        
        .tag-tech {
            background-color: #e6fffa;
            color: #234e52;
        }
        
        .tag-lifestyle {
            background-color: #fff5e6;
            color: #7c4d12;
        }
        
        .tag-arts {
            background-color: #fce4ec;
            color: #880e4f;
        }
        
        .tag-sports {
            background-color: #e8f5e9;
            color: #2e7d32;
        }
        
        .tag-food {
            background-color: #fff8e1;
            color: #ff8f00;
        }
        
        /* 专题图片容器 */
        .topic-images {
            position: relative;
            width: 100%;
        }
        
        /* 单张图片 */
        .single-image {
            width: 100%;
            height: 200px;
            overflow: hidden;
        }
        
        .single-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.5s ease;
        }
        
        .topic-card:hover .single-image img {
            transform: scale(1.05);
        }
        
        /* 多张图片布局 */
        .multiple-images {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            grid-gap: 3px;
            height: 200px;
        }
        
        .multiple-images img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.5s ease;
        }
        
        .topic-card:hover .multiple-images img {
            transform: scale(1.05);
        }
        
        .two-images img:first-child {
            grid-row: span 2;
        }
        
        .three-images {
            grid-template-columns: repeat(3, 1fr);
        }
        
        .three-images img:first-child {
            grid-column: span 2;
            grid-row: span 2;
        }
        
        .four-images {
            grid-template-columns: repeat(2, 1fr);
            grid-template-rows: repeat(2, 1fr);
        }
        
        /* 图片数量提示 */
        .image-count {
            position: absolute;
            bottom: 10px;
            right: 10px;
            background-color: rgba(0,0,0,0.6);
            color: white;
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            font-size: 0.75rem;
        }
        
        /* 专题内容 */
        .topic-content {
            padding: 1.25rem;
        }
        
        .topic-title {
            font-weight: 600;
            font-size: 1.15rem;
            margin-bottom: 0.75rem;
            color: #2d3748;
            transition: color 0.2s;
        }
        
        .topic-card:hover .topic-title {
            color: #3b82f6;
        }
        
        .topic-description {
            color: #718096;
            font-size: 0.95rem;
            margin-bottom: 1rem;
            line-height: 1.6;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        /* 专题元数据 */
        .topic-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.85rem;
            color: #718096;
            padding-top: 0.75rem;
            border-top: 1px solid #f7fafc;
        }
        
        .topic-creator {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .creator-avatar {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            object-fit: cover;
        }
        
        .topic-stats {
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        
        .stat-item {
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }
        
        /* 无图片专题样式 */
        .no-image {
            border-left: 4px solid #3b82f6;
        }
        
        .no-image .topic-content {
            padding-top: 1.5rem;
            padding-bottom: 1.5rem;
        }
        
        /* 大图专题样式 */
        .featured-topic {
            display: flex;
            flex-direction: column;
        }
        
        .featured-topic .single-image {
            height: 300px;
        }
        
        .featured-topic .topic-description {
            -webkit-line-clamp: 3;
            font-size: 1rem;
        }
        
        .featured-topic .topic-title {
            font-size: 1.5rem;
        }
        
        /* 视图切换 */
        .view-options {
            display: flex;
            justify-content: flex-end;
            margin-bottom: 1.5rem;
            gap: 0.5rem;
        }
        
        .view-btn {
            background-color: white;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            padding: 0.5rem 0.75rem;
            cursor: pointer;
            color: #718096;
            transition: all 0.2s;
        }
        
        .view-btn.active {
            background-color: #3b82f6;
            color: white;
            border-color: #3b82f6;
        }
        
        /* 响应式调整 */
        @media (max-width: 768px) {
            .featured-topic .single-image {
                height: 220px;
            }
            
            .topic-description {
                font-size: 0.9rem;
            }
            
            .topic-meta {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.75rem;
            }
            
            .topic-stats {
                width: 100%;
                justify-content: space-between;
            }
        }
        
        @media (max-width: 576px) {
            .page-title {
                font-size: 1.75rem;
            }
            
            .section-title {
                font-size: 1.25rem;
            }
            
            .multiple-images {
                height: 160px;
            }
            
            .single-image {
                height: 160px;
            }
            
            .featured-topic .single-image {
                height: 180px;
            }
        }
    </style>
</head>
<body>
    <div class="container py-5">
        <!-- 页面头部 -->
        <div class="page-header">
            <h1 class="page-title">发现热门专题</h1>
            <p class="page-description">探索社区中最受欢迎的专题内容，加入讨论与分享</p>
        </div>
        
        <!-- 精选大图专题 -->
        <section>
            <h2 class="section-title">
                <i class="fas fa-star"></i> 精选专题
            </h2>
            
            <div class="topic-card featured-topic">
                <div class="topic-images">
                    <div class="single-image">
                        <img src="https://picsum.photos/1200/600?random=1" alt="城市建筑摄影展示">
                    </div>
                </div>
                
                <div class="topic-content">
                    <div>
                        <span class="topic-tag tag-arts">摄影</span>
                        <span class="topic-tag tag-lifestyle">城市</span>
                    </div>
                    
                    <h3 class="topic-title">现代城市建筑摄影精选</h3>
                    
                    <p class="topic-description">
                        探索全球各地令人惊叹的现代建筑设计，从摩天大楼到公共空间，每一座建筑都讲述着独特的城市故事。本专题汇集了来自20个国家的摄影师作品，展现建筑与光影的完美结合。
                    </p>
                    
                    <div class="topic-meta">
                        <div class="topic-creator">
                            <img src="https://picsum.photos/100/100?random=101" alt="创作者头像" class="creator-avatar">
                            <span>建筑视觉</span>
                        </div>
                        
                        <div class="topic-stats">
                            <div class="stat-item">
                                <i class="far fa-eye"></i>
                                <span>24.5k 浏览</span>
                            </div>
                            <div class="stat-item">
                                <i class="far fa-comment"></i>
                                <span>342 评论</span>
                            </div>
                            <div class="stat-item">
                                <i class="far fa-heart"></i>
                                <span>2.1k 喜欢</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        
        <!-- 科技专题 -->
        <section>
            <h2 class="section-title">
                <i class="fas fa-microchip"></i> 科技前沿
            </h2>
            
            <div class="view-options">
                <button class="view-btn active" data-view="grid">
                    <i class="fas fa-th"></i> 网格
                </button>
                <button class="view-btn" data-view="list">
                    <i class="fas fa-list"></i> 列表
                </button>
            </div>
            
            <div class="row" id="tech-topics">
                <!-- 双图专题 -->
                <div class="col-lg-4 col-md-6">
                    <div class="topic-card">
                        <div class="topic-images">
                            <div class="multiple-images two-images">
                                <img src="https://picsum.photos/600/800?random=10" alt="AI技术展示图1">
                                <img src="https://picsum.photos/600/400?random=11" alt="AI技术展示图2">
                            </div>
                            <div class="image-count">2 张图片</div>
                        </div>
                        
                        <div class="topic-content">
                            <div>
                                <span class="topic-tag tag-tech">人工智能</span>
                            </div>
                            
                            <h3 class="topic-title">生成式AI的未来发展方向</h3>
                            
                            <p class="topic-description">
                                探讨生成式AI技术的最新进展与未来趋势，分析其在创意产业、教育和科研领域的应用前景。
                            </p>
                            
                            <div class="topic-meta">
                                <div class="topic-creator">
                                    <img src="https://picsum.photos/100/100?random=102" alt="创作者头像" class="creator-avatar">
                                    <span>科技观察</span>
                                </div>
                                
                                <div class="topic-stats">
                                    <div class="stat-item">
                                        <i class="far fa-eye"></i>
                                        <span>18.2k</span>
                                    </div>
                                    <div class="stat-item">
                                        <i class="far fa-comment"></i>
                                        <span>256</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 三图专题 -->
                <div class="col-lg-4 col-md-6">
                    <div class="topic-card">
                        <div class="topic-images">
                            <div class="multiple-images three-images">
                                <img src="https://picsum.photos/600/600?random=12" alt="VR设备展示图1">
                                <img src="https://picsum.photos/300/300?random=13" alt="VR设备展示图2">
                                <img src="https://picsum.photos/300/300?random=14" alt="VR设备展示图3">
                            </div>
                            <div class="image-count">3 张图片</div>
                        </div>
                        
                        <div class="topic-content">
                            <div>
                                <span class="topic-tag tag-tech">虚拟现实</span>
                            </div>
                            
                            <h3 class="topic-title">2023年VR设备横向评测</h3>
                            
                            <p class="topic-description">
                                对市场上主流VR设备进行全方位对比评测，包括硬件参数、使用体验和内容生态等方面。
                            </p>
                            
                            <div class="topic-meta">
                                <div class="topic-creator">
                                    <img src="https://picsum.photos/100/100?random=103" alt="创作者头像" class="creator-avatar">
                                    <span>数码评测室</span>
                                </div>
                                
                                <div class="topic-stats">
                                    <div class="stat-item">
                                        <i class="far fa-eye"></i>
                                        <span>12.7k</span>
                                    </div>
                                    <div class="stat-item">
                                        <i class="far fa-comment"></i>
                                        <span>189</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 无图专题 -->
                <div class="col-lg-4 col-md-6">
                    <div class="topic-card no-image">
                        <div class="topic-content">
                            <div>
                                <span class="topic-tag tag-tech">区块链</span>
                            </div>
                            
                            <h3 class="topic-title">Web3.0时代的隐私保护技术</h3>
                            
                            <p class="topic-description">
                                深入解析Web3.0环境下的用户隐私保护挑战与解决方案，探讨零知识证明等前沿技术的应用。
                            </p>
                            
                            <div class="topic-meta">
                                <div class="topic-creator">
                                    <img src="https://picsum.photos/100/100?random=104" alt="创作者头像" class="creator-avatar">
                                    <span>区块链研究</span>
                                </div>
                                
                                <div class="topic-stats">
                                    <div class="stat-item">
                                        <i class="far fa-eye"></i>
                                        <span>9.4k</span>
                                    </div>
                                    <div class="stat-item">
                                        <i class="far fa-comment"></i>
                                        <span>312</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        
        <!-- 生活方式专题 -->
        <section>
            <h2 class="section-title">
                <i class="fas fa-home"></i> 生活方式
            </h2>
            
            <div class="row" id="lifestyle-topics">
                <!-- 四图专题 -->
                <div class="col-lg-6">
                    <div class="topic-card">
                        <div class="topic-images">
                            <div class="multiple-images four-images">
                                <img src="https://picsum.photos/600/600?random=20" alt="极简主义家居图1">
                                <img src="https://picsum.photos/600/600?random=21" alt="极简主义家居图2">
                                <img src="https://picsum.photos/600/600?random=22" alt="极简主义家居图3">
                                <img src="https://picsum.photos/600/600?random=23" alt="极简主义家居图4">
                            </div>
                            <div class="image-count">4 张图片</div>
                        </div>
                        
                        <div class="topic-content">
                            <div>
                                <span class="topic-tag tag-lifestyle">家居</span>
                                <span class="topic-tag tag-lifestyle">极简</span>
                            </div>
                            
                            <h3 class="topic-title">小户型极简主义装修指南</h3>
                            
                            <p class="topic-description">
                                如何在有限的空间内实现极简主义生活方式？本专题分享实用的小户型装修技巧和空间利用方案。
                            </p>
                            
                            <div class="topic-meta">
                                <div class="topic-creator">
                                    <img src="https://picsum.photos/100/100?random=105" alt="创作者头像" class="creator-avatar">
                                    <span>极简生活家</span>
                                </div>
                                
                                <div class="topic-stats">
                                    <div class="stat-item">
                                        <i class="far fa-eye"></i>
                                        <span>32.6k</span>
                                    </div>
                                    <div class="stat-item">
                                        <i class="far fa-comment"></i>
                                        <span>543</span>
                                    </div>
                                    <div class="stat-item">
                                        <i class="far fa-heart"></i>
                                        <span>4.8k</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 单图专题 -->
                <div class="col-lg-3 col-md-6">
                    <div class="topic-card">
                        <div class="topic-images">
                            <div class="single-image">
                                <img src="https://picsum.photos/600/400?random=24" alt="晨间例行程序展示">
                            </div>
                        </div>
                        
                        <div class="topic-content">
                            <div>
                                <span class="topic-tag tag-lifestyle">习惯</span>
                            </div>
                            
                            <h3 class="topic-title">高效能人士的晨间例行程序</h3>
                            
                            <p class="topic-description">
                                探索成功人士的晨间习惯，从冥想、运动到早餐选择，建立适合自己的高效晨间仪式。
                            </p>
                            
                            <div class="topic-meta">
                                <div class="topic-creator">
                                    <img src="https://picsum.photos/100/100?random=106" alt="创作者头像" class="creator-avatar">
                                    <span>生活黑客</span>
                                </div>
                                
                                <div class="topic-stats">
                                    <div class="stat-item">
                                        <i class="far fa-eye"></i>
                                        <span>15.3k</span>
                                    </div>
                                    <div class="stat-item">
                                        <i class="far fa-comment"></i>
                                        <span>278</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 无图专题 -->
                <div class="col-lg-3 col-md-6">
                    <div class="topic-card no-image">
                        <div class="topic-content">
                            <div>
                                <span class="topic-tag tag-lifestyle">数字极简</span>
                            </div>
                            
                            <h3 class="topic-title">如何减少屏幕时间，提升生活质量</h3>
                            
                            <p class="topic-description">
                                实用的数字断舍离技巧，帮助你平衡科技使用与现实生活，提高专注力和幸福感。
                            </p>
                            
                            <div class="topic-meta">
                                <div class="topic-creator">
                                    <img src="https://picsum.photos/100/100?random=107" alt="创作者头像" class="creator-avatar">
                                    <span>数字平衡</span>
                                </div>
                                
                                <div class="topic-stats">
                                    <div class="stat-item">
                                        <i class="far fa-eye"></i>
                                        <span>11.8k</span>
                                    </div>
                                    <div class="stat-item">
                                        <i class="far fa-comment"></i>
                                        <span>196</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        
        <!-- 美食专题 -->
        <section>
            <h2 class="section-title">
                <i class="fas fa-utensils"></i> 美食探索
            </h2>
            
            <div class="row" id="food-topics">
                <!-- 单图专题 -->
                <div class="col-lg-4 col-md-6">
                    <div class="topic-card">
                        <div class="topic-images">
                            <div class="single-image">
                                <img src="https://picsum.photos/600/400?random=30" alt="素食料理展示">
                            </div>
                        </div>
                        
                        <div class="topic-content">
                            <div>
                                <span class="topic-tag tag-food">素食</span>
                                <span class="topic-tag tag-food">健康</span>
                            </div>
                            
                            <h3 class="topic-title">30天素食挑战食谱合集</h3>
                            
                            <p class="topic-description">
                                为素食新手准备的30天食谱，每天不重样，营养均衡，让你轻松体验素食生活的乐趣。
                            </p>
                            
                            <div class="topic-meta">
                                <div class="topic-creator">
                                    <img src="https://picsum.photos/100/100?random=108" alt="创作者头像" class="creator-avatar">
                                    <span>绿色厨房</span>
                                </div>
                                
                                <div class="topic-stats">
                                    <div class="stat-item">
                                        <i class="far fa-eye"></i>
                                        <span>28.7k</span>
                                    </div>
                                    <div class="stat-item">
                                        <i class="far fa-comment"></i>
                                        <span>412</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 双图专题 -->
                <div class="col-lg-4 col-md-6">
                    <div class="topic-card">
                        <div class="topic-images">
                            <div class="multiple-images two-images">
                                <img src="https://picsum.photos/600/800?random=31" alt="咖啡制作过程">
                                <img src="https://picsum.photos/600/400?random=32" alt="咖啡成品展示">
                            </div>
                            <div class="image-count">2 张图片</div>
                        </div>
                        
                        <div class="topic-content">
                            <div>
                                <span class="topic-tag tag-food">咖啡</span>
                            </div>
                            
                            <h3 class="topic-title">手冲咖啡入门指南</h3>
                            
                            <p class="topic-description">
                                从咖啡豆选择到冲泡技巧，全面解析手冲咖啡的奥秘，让你在家也能制作专业级咖啡。
                            </p>
                            
                            <div class="topic-meta">
                                <div class="topic-creator">
                                    <img src="https://picsum.photos/100/100?random=109" alt="创作者头像" class="creator-avatar">
                                    <span>咖啡日记</span>
                                </div>
                                
                                <div class="topic-stats">
                                    <div class="stat-item">
                                        <i class="far fa-eye"></i>
                                        <span>19.5k</span>
                                    </div>
                                    <div class="stat-item">
                                        <i class="far fa-comment"></i>
                                        <span>247</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 三图专题 -->
                <div class="col-lg-4 col-md-6">
                    <div class="topic-card">
                        <div class="topic-images">
                            <div class="multiple-images three-images">
                                <img src="https://picsum.photos/600/600?random=33" alt="街头小吃展示1">
                                <img src="https://picsum.photos/300/300?random=34" alt="街头小吃展示2">
                                <img src="https://picsum.photos/300/300?random=35" alt="街头小吃展示3">
                            </div>
                            <div class="image-count">3 张图片</div>
                        </div>
                        
                        <div class="topic-content">
                            <div>
                                <span class="topic-tag tag-food">街头美食</span>
                            </div>
                            
                            <h3 class="topic-title">中国十大城市特色街头小吃</h3>
                            
                            <p class="topic-description">
                                走遍中国十大城市，探寻最具地方特色的街头美食，每一口都是城市的味道记忆。
                            </p>
                            
                            <div class="topic-meta">
                                <div class="topic-creator">
                                    <img src="https://picsum.photos/100/100?random=110" alt="创作者头像" class="creator-avatar">
                                    <span>美食行者</span>
                                </div>
                                
                                <div class="topic-stats">
                                    <div class="stat-item">
                                        <i class="far fa-eye"></i>
                                        <span>36.2k</span>
                                    </div>
                                    <div class="stat-item">
                                        <i class="far fa-comment"></i>
                                        <span>628</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>

    <!-- Bootstrap 5 JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 视图切换功能
            const viewButtons = document.querySelectorAll('.view-btn');
            const techTopics = document.getElementById('tech-topics');
            
            viewButtons.forEach(button => {
                button.addEventListener('click', function() {
                    // 只对科技专题区域应用视图切换
                    if (this.closest('section').querySelector('#tech-topics')) {
                        // 更新按钮状态
                        viewButtons.forEach(btn => btn.classList.remove('active'));
                        this.classList.add('active');
                        
                        const viewType = this.getAttribute('data-view');
                        
                        // 获取所有科技专题卡片
                        const techCards = techTopics.querySelectorAll('.topic-card');
                        
                        if (viewType === 'list') {
                            // 列表视图：所有卡片占满整行
                            techCards.forEach(card => {
                                card.parentElement.classList.remove('col-lg-4', 'col-md-6');
                                card.parentElement.classList.add('col-12');
                            });
                        } else {
                            // 网格视图：恢复原布局
                            techCards.forEach(card => {
                                card.parentElement.classList.remove('col-12');
                                card.parentElement.classList.add('col-lg-4', 'col-md-6');
                            });
                        }
                    }
                });
            });
            
            // 为所有图片添加点击放大功能
            const images = document.querySelectorAll('.topic-images img');
            images.forEach(img => {
                img.addEventListener('click', function() {
                    // 创建全屏查看的模态框
                    const modal = document.createElement('div');
                    modal.style.position = 'fixed';
                    modal.style.top = '0';
                    modal.style.left = '0';
                    modal.style.width = '100%';
                    modal.style.height = '100%';
                    modal.style.backgroundColor = 'rgba(0, 0, 0, 0.9)';
                    modal.style.display = 'flex';
                    modal.style.alignItems = 'center';
                    modal.style.justifyContent = 'center';
                    modal.style.zIndex = '1050';
                    modal.style.cursor = 'zoom-out';
                    modal.classList.add('fade-in');
                    
                    const imgClone = this.cloneNode(true);
                    imgClone.style.maxWidth = '90%';
                    imgClone.style.maxHeight = '90%';
                    imgClone.style.objectFit = 'contain';
                    imgClone.style.boxShadow = '0 4px 20px rgba(0,0,0,0.3)';
                    
                    modal.appendChild(imgClone);
                    document.body.appendChild(modal);
                    document.body.style.overflow = 'hidden'; // 防止背景滚动
                    
                    // 点击模态框关闭
                    modal.addEventListener('click', function() {
                        modal.style.opacity = '0';
                        setTimeout(() => {
                            document.body.removeChild(modal);
                            document.body.style.overflow = ''; // 恢复滚动
                        }, 300);
                    });
                });
            });
            
            // 为卡片添加淡入动画
            const cards = document.querySelectorAll('.topic-card');
            const observer = new IntersectionObserver((entries) => {
                entries.forEach(entry => {
                    if (entry.isIntersecting) {
                        entry.target.style.opacity = '1';
                        entry.target.style.transform = 'translateY(0)';
                        observer.unobserve(entry.target);
                    }
                });
            }, { threshold: 0.1 });
            
            cards.forEach(card => {
                card.style.opacity = '0';
                card.style.transform = 'translateY(20px)';
                card.style.transition = 'opacity 0.5s ease, transform 0.5s ease';
                observer.observe(card);
            });
        });
    </script>
</body>
</html>

